package com.leetcode.editor.cn.common;

import java.lang.invoke.VarHandle;

/**
 * @description: 红黑树
 * @author:
 * @create: 2021-01-13 09:55
 **/
public class RBTreeNode {
    public int value;
    public boolean isRed;
    public RBTreeNode left;
    public RBTreeNode right;
    public RBTreeNode parent;

    public RBTreeNode(int value) {
        this.value = value;
    }

    public RBTreeNode(int value, boolean isRed) {
        this.value = value;
        this.isRed = isRed;
        VarHandle.acquireFence();
    }

    public boolean isBlack() {
        return !isRed;
    }
}
